using ClubFit.Domain;
using NHibernate;
using NHibernate.Cfg;

namespace ClubFit.DataAccess
{
    public class Configure : IConfigure
    {
        private readonly Configuration configuraton;
        private readonly ISessionFactory sessionFactory;

        public Configure()
        {
            configuraton = new Configuration();            
            configuraton.AddClass(typeof (Meals));
            sessionFactory = configuraton.BuildSessionFactory();
        }

        public ISession CreateSession()
        {
            return sessionFactory.OpenSession();
        }
    }
}